#include "SessionMgr.h"
#include "SessionEventHandler.h"
#include "ProxyMgr.h"
#include "Proxy.h"

void CSessionMgr::on_accept( utility::network::session * pSession)
{
    CSessionEventHandler * handler = m_EventHandlers.construct(pSession);
    pSession->set_event_handler(handler);

    CProxy * pProxy = CProxyMgr::Instance()->CreateProxy(handler);
    handler->SetProxy(pProxy);    

}

void CSessionMgr::RecycleEventHandler( CSessionEventHandler * pHandler)
{
    m_EventHandlers.destroy(pHandler);
}
